修改Linux内核添加Air72X 4G模块支持 | 您所在的位置:网站首页 › 合宙4G Air724UG开发板 › 修改Linux内核添加Air72X 4G模块支持 |
修改Linux内核添加Air72X 4G模块支持
这话从何说起呢,还是疫情之前吧,那会合宙刚刚推出Air724模块,脑子一热,团购了一个,以为没团上,然后小号又团了一次,然后就有了两个了。然后和囤积的大多数东西一样没有然后了 。类似这款,但是显然比他早。 这里主要涉及到一个文件“drivers/usb/serial/option.c”,添加usb设备的PID和VID,我用的是Air724UG模块,其PID和VID是{0x1782, 0x4e00},另外还添加了一个,可能是另外一种类型模块的。 //1. 更改option_ids数组,大约在630行左右,可以搜一下 static const struct usb_device_id option_ids[] = { //在数组中添加以下USB设备的PID和VID //Air72X 4G模块 {USB_DEVICE(0x1286, 0x4e3d)}, {USB_DEVICE(0x1782, 0x4e00)}, //在下边是原来就有的设备的PID和VID,不需要修改 {USB_DEVICE(0x19d2, 0x0117)}, /* ME3630*/ {USB_DEVICE(0x19d2, 0x0199)}, {USB_DEVICE(0x19d2, 0x1476)}, 。。。。。。。。。。。。。。。 。。。。。。。。。。。。。。。 //2. 更改option_probe函数,大约在1865行左右 static int option_probe(struct usb_serial *serial, const struct usb_device_id *id) { struct usb_interface_descriptor *iface_desc = &serial->interface->cur_altsetting->desc; //这一行本来是要添加的,但是正点原子已经给添加了,所以,就不用了 struct usb_device_descriptor *dev_desc = &serial->dev->descriptor; const struct option_blacklist_info *blacklist; /* Never bind to the CD-Rom emulation interface */ if (iface_desc->bInterfaceClass == 0x08) return -ENODEV; //。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 //这部分是中间一堆代码,我没有复制过来 //。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 if (dev_desc->idVendor == cpu_to_le16(0x05c6) && dev_desc->idProduct == cpu_to_le16(0x9215) && iface_desc->bInterfaceNumber >= 4) return -ENODEV; if (dev_desc->idVendor == cpu_to_le16(0x2c7c) && iface_desc->bInterfaceNumber >= 4) return -ENODEV; //在接紧最下边,添加下述两个if条件 //Air72X if (dev_desc->idVendor == cpu_to_le16(0x1286) && dev_desc->idProduct == cpu_to_le16(0x4e3d) && iface_desc->bInterfaceNumber idVendor == cpu_to_le16(0x1782) && dev_desc->idProduct == cpu_to_le16(0x4e00) && iface_desc->bInterfaceNumber |
CopyRight 2018-2019 实验室设备网 版权所有 |